/*
 * MemoryTest.h
 *
 *  Created on: 2009/12/29
 *      Author: kevin
 */

#ifndef TEST_H_
#define TEST_H_

#include "pool/Thread.h"

class ThTarget: public CRunnable{
public:
	virtual void Run();
};

class NormalBase{
public:
	NormalBase(){};

	virtual ~NormalBase(){};
};

class NormalDerive : public NormalBase{
public:
	NormalDerive();
	NormalDerive(float posX, float posY);
	inline float GetPosX() { return m_posX; }
	inline float GetPosY() { return m_posY; }
	inline void SetPosX(float posX) { m_posX = posX; }
	inline void SetPosY(float posY) { m_posY = posY; }
private:
	float m_posX;
	float m_posY;
};

/*
 * Test Case
 */
class CTest{
public:
	CTest();
	virtual ~CTest();
	CTest(int _subThNum);
	virtual void run_test() = 0;
	static THREAD_ENTRY_FUNC(test_func_entry);
protected:
	void dumpTestResult(float elapsedTime,bool bPoolUsed);
protected:
	int m_subThNum;
};

class CMemPool : public CTest{
	typedef CTest SUPER;
public:
	CMemPool();
	CMemPool(int _subThNum);
	virtual void run_test();
};

class CNormal : public CTest{
	typedef CTest SUPER;
public:
	CNormal();
	CNormal(int _subThNum);
	virtual void run_test();
};

#endif /* TEST_H_ */
